package gui.gui2d.highLevelPanels.utils;

import java.awt.Color;
import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.Image;
import java.awt.Toolkit;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JPanel;
import javax.swing.Timer;

public class Animation  extends JPanel implements ActionListener {
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private Image img; 
	private Timer t;
	public Animation() {
		super () ; 
		this.setOpaque(false);
		setPreferredSize(new Dimension (160,180) ); 
		img = Toolkit.getDefaultToolkit () .getImage ("images//wait.gif"); 
		t = new Timer (10,this); 
		t.start () ; 
	}
	@Override
	public void actionPerformed(ActionEvent arg0) {
		repaint();
	}
	@Override
	public void paintComponent (Graphics g) { 
		super.paintComponent (g); 
		g.drawImage (img, 20, 20, null); 
		}
	public void stop() {
		t.stop();
	} 

}
